class CombinedProvider {
    constructor() {
        /* eslint-disable import/no-require */
        this.actions = {
            // Widgets: () => require('actions/widgets/WidgetsActions'),
        };
        this.stores = {
            // Widgets: () => require('stores/widgets/WidgetsStore'),
        };
        /* eslint-enable import/no-require */
    }

    get(name) {
        const result = {};
        if (this.stores[name]) {
            result[`${name}Store`] = this.stores[name]();
        }
        if (this.actions[name]) {
            result[`${name}Actions`] = this.actions[name]();
        }
        return result;
    }
}

if (typeof window.combinedProvider === 'undefined') {
    window.combinedProvider = new CombinedProvider();
}

export default window.combinedProvider;
